cmake_minimum_required(VERSION 3.20)

# 项目名称
project(
  VTKExport
  VERSION 0.1.0
  LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 14)

# 获取源文件
file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)

# 添加动态库
add_library(${PROJECT_NAME} SHARED ${SOURCES})

# 目标添加链接库
target_link_libraries(${PROJECT_NAME} PRIVATE Algebra DataStructure DBManager Framework)

# 安装头文件
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
        DESTINATION include/Export/
        FILES_MATCHING
        PATTERN "*.h"
        PATTERN "UnitTest" EXCLUDE
        )

# 安装目标
install(
    TARGETS ${PROJECT_NAME}
    ARCHIVE DESTINATION lib
    LIBRARY DESTINATION lib
    RUNTIME DESTINATION bin)

# 添加单元测试子项目
if(SG_BUILD_UNIT_TEST)
    add_subdirectory(UnitTest)
endif()